<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateArticlesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('articles', function (Blueprint $table) {
            $table->increments('id');
            $table->string('title')->comment('标题');
            $table->string('file')->comment('压缩包地址');
            $table->string('url')->comment('链接地址');
            $table->string('image')->comment('封面');
            $table->integer('cat_id1')->comment('关联分类二级分类');
            $table->integer('cat_id2')->default('0')->comment('关联分类三级分类');
            $table->integer('viewnum')->default('0')->comment('浏览量');
            $table->integer('downnum')->default('0')->comment('下载数');
            $table->integer('collecnum')->default('0')->comment('收藏数');
            $table->integer('style')->default('0')->comment('风格');
            $table->tinyInteger('status')->default('0')->comment('0审核中,1已通过，2未通过');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('articles');
    }
}
